package com.atguigu.gulimallcart.vo;

import java.math.BigDecimal;
import java.util.List;

/**
 * @ClassName CartItem
 * @Description TODO
 * @Detail 购物车的每个商品
 * @Author MyPC
 * @Date 2020/7/13
 * @Version 1.0
 */
public class CartItem {
    private Long skuId;
    //是否选中，默认选中
    private Boolean check=true;
    private String title;
    //默认图片
    private String image;
    //选中的销售属性数组
    private List<String> skuAttrs;
    private BigDecimal price;
    private Integer count;
    private BigDecimal totalPrice;


    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Boolean getCheck() {
        return check;
    }

    public void setCheck(Boolean check) {
        this.check = check;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public List<String> getSkuAttrs() {
        return skuAttrs;
    }

    public void setSkuAttrs(List<String> skuAttrs) {
        this.skuAttrs = skuAttrs;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    //总价格需要动态计算,即商品件数+每件价格
    public BigDecimal getTotalPrice() {
        return this.price.multiply(new BigDecimal(""+this.count));
    }


}
